package ejb.cbm.commons;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.ResourceBundle;

//import javax.ejb.Stateless;
import javax.naming.InitialContext;
import javax.sql.DataSource;

import org.apache.log4j.Level;
import org.apache.log4j.Logger;

import cbm.commons.Conexion;

//@Stateless
public class BaseFacade implements BaseFacadeLocal{
	
	static Logger logger = Logger.getLogger(BaseFacade.class.getName());
	
	public static ResourceBundle resources = ResourceBundle.getBundle("continuidadapp");
	
	public Connection getConnection() throws SQLException{
		/*InitialContext context = null;
		DataSource dataSource = null;
		Connection con = null;
		
		try {
			context = new InitialContext();
		    dataSource = (DataSource) context.lookup(resources.getString("datasource_lookup"));
		    con = dataSource.getConnection();
		    //con.setAutoCommit(false);
		} catch(Exception e){
			logger.log("BaseFacade.getConnection failed", Level.FATAL,null, e);
		}
	    */
	    return Conexion.getConnection();
	}
}
